The invention relates to a device and a method for treating nitrogen and phosphorus wastewater, and more particularly to a continuous flow reactor for recycling nitrogen and phosphorus from wastewater based on the crystallization principle of magnesium ammonium phosphate, and a method using the same for treating wastewater.